<%@ page import="edu.uow.devdocs.Person" %>

<table class="searchable tableForm">
	<tr>
		<td class="fieldcontain ${hasErrors(bean: personInstance, field: 'username', 'error')}"><label for="username"><g:message code="person.username.label" default="Username" /></label></td>
		<td class="fieldcontain ${hasErrors(bean: personInstance, field: 'username', 'error')}"><g:textField name="username" maxlength="50" value="${personInstance?.username}"/></td>
		<td class="fieldcontain ${hasErrors(bean: personInstance, field: 'manager', 'error')}"><label for="manager"><g:message code="person.manager.label" default="Manager" /></label></td>
		<td class="fieldcontain ${hasErrors(bean: personInstance, field: 'manager', 'error')}"><g:select id="manager" name="manager.id" from="${edu.uow.devdocs.Person.list()}" optionKey="id" value="${personInstance?.manager?.id}" class="many-to-one" noSelection="['null': '']"/></td>
	</tr>
	<tr>
		<td class="fieldcontain ${hasErrors(bean: personInstance, field: 'landingPage', 'error')}"><label for="landingPage"><g:message code="person.landingPage.label" default="Landing Page" /></label></td>
		<td class="fieldcontain ${hasErrors(bean: personInstance, field: 'landingPage', 'error')}"><g:textField name="landingPage" maxlength="50" value="${personInstance?.landingPage}"/></td>
		<td class="fieldcontain ${hasErrors(bean: personInstance, field: 'team', 'error')} required"><label for="team"><g:message code="person.team.label" default="Team" /> <span class="required-indicator">*</span></label></td>
		<td class="fieldcontain ${hasErrors(bean: personInstance, field: 'team', 'error')} required"><g:select id="team" name="team.id" from="${edu.uow.devdocs.Team.list()}" optionKey="id" required="" value="${personInstance?.team?.id}" class="many-to-one"/></td>
	</tr>
	<g:if test="${ personInstance?.id}">
	<tr>
		<td class="fieldcontain ${hasErrors(bean: personInstance, field: 'projects', 'error')}"><label for="projects"><g:message code="person.projects.label" default="Projects" /></label></td>
		<td colspan="3" class="fieldcontain ${hasErrors(bean: personInstance, field: 'projects', 'error')}"><g:select name="projects" from="${edu.uow.devdocs.Project.list()}" multiple="multiple" optionKey="id" size="10" value="${edu.uow.devdocs.Project.findAllByAvailableToAllFlag(false)*.id}" class="many-to-many large"/></td>
	</tr>
	</g:if>
</table>
